/*
 * @(#)PixManagerWebService.java
 * Date 2013-04-04
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.pix.ws;

import javax.inject.Inject;

import javax.jws.WebService;

import javax.xml.ws.BindingType;

import javax.xml.ws.soap.SOAPBinding;

import ihe.iti.pixv3._2007.PIXManagerPortType;

import org.hl7.v3.MCCIIN000002UV01;
import org.hl7.v3.PRPAIN201301UV02;
import org.hl7.v3.PRPAIN201302UV02;
import org.hl7.v3.PRPAIN201304UV02;
import org.hl7.v3.PRPAIN201309UV02;
import org.hl7.v3.PRPAIN201310UV02;

import us.hornerscorners.lamppost.pix.service.IPatientQueryService;
import us.hornerscorners.lamppost.pix.service.IPatientRegistryService;


/**
 * Class description
 *
 *
 * @version        v1.0, 2013-04-04
 * @author         Jim Horner
 */
@WebService(
    portName = "PIXManager_Port_Soap12",
    serviceName = "PIXManager_Service",
    targetNamespace = "urn:ihe:iti:pixv3:2007",
    endpointInterface = "ihe.iti.pixv3._2007.PIXManagerPortType",
    wsdlLocation = "WEB-INF/wsdl/pix/PIXManager.wsdl"
)
@BindingType(SOAPBinding.SOAP12HTTP_BINDING)
public class PixManagerWebService implements PIXManagerPortType {

    /** Field description */
    @Inject
    private IPatientQueryService patientQueryService;

    /** Field description */
    @Inject
    private IPatientRegistryService patientRegistryService;

    /**
     * Patient Record Added
     *
     *
     * @param body
     *
     * @return
     */
    @Override
    public MCCIIN000002UV01 pixManagerPRPAIN201301UV02(PRPAIN201301UV02 body) {

        MCCIIN000002UV01 result = null;

        // register patient
        try {

            result = this.patientRegistryService.registerPatient(body);

        } catch (Exception e) {

            // create a response
        }

        return result;
    }

    /**
     * Patient Record Revised
     *
     *
     * @param body
     *
     * @return
     */
    @Override
    public MCCIIN000002UV01 pixManagerPRPAIN201302UV02(PRPAIN201302UV02 body) {

        MCCIIN000002UV01 result = null;

        return result;
    }

    /**
     * Patient Duplicates Resolved
     *
     *
     * @param body
     *
     * @return
     */
    @Override
    public MCCIIN000002UV01 pixManagerPRPAIN201304UV02(PRPAIN201304UV02 body) {

        MCCIIN000002UV01 result = null;

        return result;
    }

    /**
     * Patient Get Identifiers
     *
     *
     * @param body
     *
     * @return
     */
    @Override
    public PRPAIN201310UV02 pixManagerPRPAIN201309UV02(PRPAIN201309UV02 body) {

        PRPAIN201310UV02 result = null;

        // retrieve patient identifiers
        try {

            result = this.patientQueryService.retrieveIdentifiers(body);

        } catch (Exception e) {

            // create a response
        }

        return result;
    }
}
